﻿package com.condorcom.air.net{	import air.net.URLMonitor;		import flash.events.EventDispatcher;	import flash.events.StatusEvent;	import flash.net.URLRequest;		public class CheckConnection extends EventDispatcher	{		private var monitor:URLMonitor;		private var _url:String;					public function CheckIfOnline( _url:String = "http://www.google.com" ):void		{			var request:URLRequest =  new URLRequest( _url );			request.method = "HEAD";							monitor = new URLMonitor( request );			monitor.addEventListener( StatusEvent.STATUS, handle_status );			monitor.start();		}				private function handle_status( event:StatusEvent ):void		{			dispatchEvent( event );		}				public function get available():Boolean		{			return monitor.available;		}	}}